/* 
 * File:   Error.h
 * Author: mori
 *
 * Created on May 2, 2011, 6:04 PM
 */
#include <math.h>
#include "Grid.h"
#include <stdio.h>
#include <matrix.h>

#include "Log.h"

extern Log* plog;



#ifndef _NO_NAMESPACE
using namespace std;
using namespace math;
#define STD std
#else
#define STD
#endif

#ifndef _NO_TEMPLATE
typedef matrix<float> Matrix;
#else
typedef matrix Matrix;
#endif

#ifndef _NO_EXCEPTION
#define TRYBEGIN()	try {
#define CATCHERROR()	} catch (const STD::exception& e) { \
						cerr << "Error: " << e.what() << endl; }
#else
#define TRYBEGIN()
#define CATCHERROR()
#endif



//extern psi
using namespace std;

#ifndef _ERROR_H
#define	_ERROR_H

class Error {
  public:  Error(Grid* g);
      
         float getValue(float** psipl, float** psipl_mnxt);
         float getValue(Matrix m1, Matrix m2);
  private:
           Grid* grid;
    int num_r;
    int num_z;
    float left_r;
    float down_z;
    float h_r;
    float h_z;
    float delta_s;

    

};

#endif	/* _ERROR_H */

